package com.flitsneak.designpatterns.behavioralpatterns.templatemethod;

/**
 * Author: flitsneak
 * Date: 2022/6/6 10:32
 * Description:
 */
public class NormalDay extends BPlanTemplate{
    private boolean buyDessertFlag = false;
    @Override
    protected String buyFruit() {
        System.out.println("买苹果！");
        return "买苹果！";
    }

    @Override
    protected String buyDessert() {
        System.out.println("买冰淇淋!");
        return "买冰淇淋！";
    }

    @Override
    protected boolean isBuyDessert() {
        return this.buyDessertFlag;
    }

    public void setDessertFlag(boolean isBuyDessert) {
        this.buyDessertFlag = isBuyDessert;
    }
}
